from WebBackend.dataclass.Configuration import ConfigurationItem

GLOBAL_OPTIONS: list[ConfigurationItem] = [

    {
        "key": "listen",
        "default": "NO",
        "description": "以独立模式运行（非 inetd/xinetd）"
    },
    {
        "key": "listen_ipv6",
        "default": "NO",
        "description": "启用 IPv6 监听"
    },
    {
        "key": "write_enable",
        "default": "NO",
        "description": "允许 FTP 写操作（全局开关，需配合用户权限）"
    },
    {
        "key": "dirmessage_enable",
        "default": "NO",
        "description": "进入目录时显示 .message 文件内容"
    },
    {
        "key": "xferlog_enable",
        "default": "NO",
        "description": "启用传输日志记录"
    },
    {
        "key": "connect_from_port_20",
        "default": "YES",
        "description": "使用 20 端口进行主动模式数据连接"
    },
    {
        "key": "xferlog_file",
        "default": "/var/log/vsftpd.log",
        "description": "传输日志文件路径"
    },
    {
        "key": "xferlog_std_format",
        "default": "NO",
        "description": "使用标准 wu-ftpd 日志格式"
    },
    {
        "key": "idle_session_timeout",
        "default": "300",
        "description": "空闲会话超时时间（秒）"
    },
    {
        "key": "data_connection_timeout",
        "default": "300",
        "description": "数据传输超时时间（秒）"
    },
    {
        "key": "max_clients",
        "default": "0",
        "description": "最大并发客户端连接数（0 表示无限制）"
    },
    {
        "key": "max_per_ip",
        "default": "0",
        "description": "每个 IP 的最大并发连接数（0 表示无限制）"
    },
    {
        "key": "pasv_enable",
        "default": "YES",
        "description": "启用被动模式（PASV）"
    },
    {
        "key": "pasv_min_port",
        "default": "0",
        "description": "被动模式最小端口号"
    },
    {
        "key": "pasv_max_port",
        "default": "0",
        "description": "被动模式最大端口号"
    },
    {
        "key": "pasv_address",
        "default": "",
        "description": "服务器公网 IP（用于 NAT 环境）"
    },
    {
        "key": "ftpd_banner",
        "default": "",
        "description": "自定义 FTP 登录欢迎信息"
    },
    {
        "key": "banner_file",
        "default": "",
        "description": "从文件读取欢迎信息（覆盖 ftpd_banner）"
    },
    {
        "key": "tcp_wrappers",
        "default": "NO",
        "description": "使用 TCP Wrappers 进行访问控制"
    },
    {
        "key": "ssl_enable",
        "default": "NO",
        "description": "启用 SSL/TLS 加密（全局开关）"
    },
    {
        "key": "rsa_cert_file",
        "default": "/etc/ssl/certs/ssl-cert-snakeoil.pem",
        "description": "SSL 证书路径"
    },
    {
        "key": "rsa_private_key_file",
        "default": "/etc/ssl/private/ssl-cert-snakeoil.key",
        "description": "SSL 私钥路径"
    },
    {
        "key": "ssl_ciphers",
        "default": "",
        "description": "指定 SSL 加密算法（如 HIGH）"
    },
    {
        "key": "async_abor_enable",
        "default": "NO",
        "description": "允许异步 ABOR 命令（兼容性选项）"
    },
    {
        "key": "ascii_upload_enable",
        "default": "NO",
        "description": "允许 ASCII 模式上传"
    },
    {
        "key": "ascii_download_enable",
        "default": "NO",
        "description": "允许 ASCII 模式下载"
    },
    {
        "key": "ls_recurse_enable",
        "default": "NO",
        "description": "允许 ls -R 递归列出目录"
    },
    {
        "key": "text_userdb_names",
        "default": "NO",
        "description": "显示用户名而非 UID/GID"
    },
    {
        "key": "use_localtime",
        "default": "NO",
        "description": "使用本地时间而非 UTC 显示文件时间"
    },
    {
        "key": "log_ftp_protocol",
        "default": "NO",
        "description": "记录所有 FTP 命令（调试用）"
    }, {
        "key": "pam_service_name",
        "default": "ftp",
        "description": "指定 PAM 服务名"
    },
]
